package com.jeesite.modules.car.entity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 图片表Entity
 * @author T
 * @version 2023-12-11
 */
@Table(name="h_image", alias="a", label="图片表信息", columns={
		@Column(name="image_id", attrName="imageId", label="主键id", isPK=true),
		@Column(name="foreign_id", attrName="foreignId", label="外键id"),
		@Column(name="image_url", attrName="imageUrl", label="图片地址"),
		@Column(name="image_type", attrName="imageType", label="类型", comment="类型（0轮播图 1详情图）"),
		@Column(name="create_by", attrName="createBy", label="创建者", isUpdate=false, isQuery=false),
		@Column(name="create_date", attrName="createDate", label="创建时间", isUpdate=false, isQuery=false),
	}, orderBy="a.image_id DESC"
)
public class Image extends DataEntity<Image> {
	
	private static final long serialVersionUID = 1L;
	private String imageId;		// 主键id
	private String foreignId;		// 外键id
	private String imageUrl;		// 图片地址
	private String imageType;		// 类型（0轮播图 1详情图）

	public Image() {
		this(null);
	}
	
	public Image(String id){
		super(id);
	}
	
	public String getImageId() {
		return imageId;
	}

	public void setImageId(String imageId) {
		this.imageId = imageId;
	}
	
	@NotBlank(message="外键id不能为空")
	@Size(min=0, max=64, message="外键id长度不能超过 64 个字符")
	public String getForeignId() {
		return foreignId;
	}

	public void setForeignId(String foreignId) {
		this.foreignId = foreignId;
	}
	
	@NotBlank(message="图片地址不能为空")
	@Size(min=0, max=255, message="图片地址长度不能超过 255 个字符")
	public String getImageUrl() {
		return imageUrl;
	}

	public void setImageUrl(String imageUrl) {
		this.imageUrl = imageUrl;
	}
	
	@NotBlank(message="类型不能为空")
	@Size(min=0, max=1, message="类型长度不能超过 1 个字符")
	public String getImageType() {
		return imageType;
	}

	public void setImageType(String imageType) {
		this.imageType = imageType;
	}
	
}